﻿<%@ Register TagPrefix="cnt" Namespace="Mysoft.Map.Application.Controls" Assembly="Mysoft.Map.Application.Components" %>
<%@ Register TagPrefix="mnu" Namespace="Mysoft.Map.Application.Menus" Assembly="Mysoft.Map.Application.Components" %>
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="Activity_Activity_Grid.aspx.vb" Inherits="PubProject.Activity_Activity_Grid" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
	<HEAD>
		<title>执行日志</title>
		<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
		<meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
		<meta name="vs_defaultClientScript" content="JavaScript">
		<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
		<script language="javascript" src="/_controls/settings.aspx"></script>
		<link rel="stylesheet" type="text/css" href="/_grid/map_grid.css">
		<link rel="stylesheet" type="text/css" href="/_common/styles/global.css">
		<link rel="stylesheet" type="text/css" href="/_nav/taskbox.css">
		<link rel="stylesheet" type="text/css" href="/_nav/menu.css">
		<link rel="stylesheet" type="text/css" href="/_forms/styles/form.css">
		<link rel="stylesheet" type="text/css" href="/_controls/find/find.css">
		<script language="javascript" src="/_common/scripts/global.js"></script>
		<script language="javascript" src="/_controls/find/find.js"></script>
			<script language="javascript" src="/_nav/menu.js"></script>
		<script language="javascript" src="/PubProject/Activity/Activity.js"></script>
		<script language="javascript">
		//在线帮助文件
		var _MyHelpfile ="/Slxt/help/topics/客户跟进/客户关怀/查看执行日志.html";
		function window.onload()
		{
			if(document.all.__mode&&document.all.__mode.value=="3")
			{
				deDisplay("m1,m2,m3");
			}
			
			if(document.all("__funcid"))
		    {				  
			    if(__funcid.value=="01030303")
			    {
			        _MyHelpfile = "/Hyxt/help/Activity_InquireLog.htm";
			    }
			    if(__funcid.value=="01040110" || __funcid.value=="01040305")
			    {
			        _MyHelpfile = "/Zlxt/help/ZSGL/Activity_InquireLog.htm";
			    }
		    }
		}
		
		function showme()
		{
            // 选中行对象数组
		    var arrTr = appGrid.frameElement.getSelected();
		    if (!arrTr) 
		    {
		      appGrid2.frameElement.customFilter="1=2";
		      appGrid2.frameElement.Query();
		      return;
		    }
		    appGrid2.frameElement.customFilter="p_Activity.ActExecGUID='"+arrTr[0].oid+"'";
		    appGrid2.frameElement.Query();
		}
		
		function delMain()
		{
			// 选中行对象数组
			var arrTr = appGrid.frameElement.getSelected();
			if (!arrTr) return;
			
			// 拼写 oids
			var oids = "";
			for ( var i = 0; i < arrTr.length; i++ )
			{
				if ( i == 0 )
					oids = arrTr[i].oid;
				else
					oids += ";" + arrTr[i].oid;
			}
			var sFile = "/PubProject/Activity/Activity_Pub_XMLHTTP.aspx";
			var ReturnValue = openXMLHTTP(sFile,"delActivityMain",oids);
			if(ReturnValue != undefined && ReturnValue != "OK")
			{
				alert("删除失败");
			}
			else
			{
				appGrid.frameElement.Query();
			}
		}
		
		function delDetail()
		{
		    // 选中行对象数组
			var arrTr = appGrid2.frameElement.getSelected();
			if (!arrTr) return;
			
			// 拼写 oids
			var oids = "";
			for ( var i = 0; i < arrTr.length; i++ )
			{
				if ( i == 0 )
					oids = arrTr[i].oid;
				else
					oids += ";" + arrTr[i].oid;
			}
			var sFile = "/PubProject/Activity/Activity_Pub_XMLHTTP.aspx?ActExecGUID=" + arrTr[0].oActGUID;
			var ReturnValue = openXMLHTTP(sFile,"delActivityDetail",oids);
			if(ReturnValue!=undefined&&ReturnValue!="OK")
			{
				alert("删除失败");
			}
			else
			{
				appGrid.frameElement.Query();
				appGrid2.frameElement.Query();
			}
		}
	
		//打开交互明细
		function OpenModiWin(sOid)
		{
		    //当线索，销售机会，定单，合同，催缴欠款模块发送短信后保存不关闭，马上看执行日志的详细交互明细，必须修改funcid
		    var sfuncid ;
		    if(parent.__funcid.value.substring(0,4)=="0101")
		    {
		        sfuncid="01010204";
		    }
		    else
		    {
		        sfuncid=parent.__funcid.value;
		    }
			var sPath = "Activity_Activity_Grid_Edit.aspx?mode=" + document.all.__mode.value + "&funcid=" + sfuncid + "&oid=" + escape(sOid);
			openMyWin(sPath);
		}
		 
		//重新发送
		function ReSendMulti()
		{
		    // 选中行对象数组
			var arrTr = appGrid2.frameElement.getSelected();
			if (!arrTr) return;
			
			// 拼写 oids
			var oids = "";
			for ( var i = 0; i < arrTr.length; i++ )
			{
				if(arrTr[i].oActStatus =="执行中")
				{
					alert("执行中的交互明细记录不能重新发送，请重新选择！");
					return;
				}
				
				if ( i == 0 )
					oids = arrTr[i].oid;
				else
					oids += ";" + arrTr[i].oid;
			}
			
			//检查参数设置是否完整
			var sFile = "/PubProject/Activity/Activity_Pub_XMLHTTP.aspx?AppName="+escape(arrTr[0].AppName)+"&ActType=" + escape(arrTr[0].ActType);
			var sRtn=GetDataFromXMLHTTP(sFile,"CheckParamSet","","","");
			if (sRtn.substr(0,2) == "NO")
			{
			    alert(sRtn.substr(3));
			    return;
			}
			else if (sRtn.substr(0,2) != "OK")
			{
			    alert("检查信息发送参数失败，请与管理员联系！");
			    return;
			}
			
			var sActGUID = arrTr[0].oActGUID;
			
			//调用重新发送公用函数重新发送
			//参数：oids	    -	交互明细GUID
            //      sActGUID	-	执行日志GUID
			var sRtn=ReSendPublic(oids,sActGUID);
			if(sRtn=="OK")
			{
				alert("发送成功！");
				appGrid.frameElement.Query();
				appGrid2.frameElement.Query();
			}
			else
			{
				alert("操作发生异常，请重新发送！");
			}
		}
		 
		</script>
	</HEAD>
	<body MS_POSITIONING="GridLayout" style="PADDING-RIGHT:10px; PADDING-LEFT:10px; PADDING-BOTTOM:10px; PADDING-TOP:10px">
		<table style="TABLE-LAYOUT: fixed; FONT-SIZE: 9pt" width="100%" height="100%" cellSpacing="0"
			cellPadding="0" border="0">
			<tr height="25">
				<td><mnu:appgridmenu id="appGridMenu" runat="server"></mnu:appgridmenu></td>
			</tr>
			<tr height="35%">
				<td><cnt:appgrid id="appGrid" runat="server" Filter="<Filter/>" AllowPaging="False" MultiSelect="true"></cnt:appgrid></td>
			</tr>
			<tr height="10">
				<td></td>
			</tr>
			<tr height="25">
				<td><mnu:appgridmenu id="appMenu2" runat="server"></mnu:appgridmenu></td>
			</tr>
			<tr>
				<td><cnt:appgrid id="appGrid2" runat="server" Filter=""></cnt:appgrid></td>
			</tr>
		</table>
	</body>
</HTML>
